package com.shelpe.services.simbasync.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.shelpe.services.simbasync.model.Adgroups;
import com.shelpe.services.simbasync.model.RptAdgroup;

public interface AdgroupsService {
	
	public int countAll();
	
	public int countByUserId(long userId);
	
	public int addAdgroups(Adgroups ad);
	
	public int addAdgroupsList(List<Adgroups> adList);
	
	public int deleteRptAdgroupsByDateRange(List<Long> adgroupIds, Date startDate, Date endDate);

	public int addRptAdgroups(RptAdgroup rpt);
	
	public int addRptAdgroupsList(List<RptAdgroup> rptList);
	
	public int insertAdgroupsBatch(List<Adgroups> adList);
	
	public int insertRptAdgroupsBatch(List<RptAdgroup> rptList);
	
	public List<Adgroups> getAdgroupsByCampaignId(long campaignId);
	
	public Adgroups getAdgroupsById(long adgroupId);
	
	public List<Adgroups> getAdgroupsByUserId(long userId);
	
	public int deleteAdgroups(Adgroups ad);
	
	public int deleteAdgroupsList(List<Adgroups> adList);
	
	public int updateAdgroups(Adgroups ad);
	
	public int updateAdgroupsList(List<Adgroups> adList);
	
	public Date getLastTimeFromRpt(long userId, long campaignId, long adgroupId);
	
	public void updateAdgroupsData(long userId, List<Adgroups> adList);
	/*-----------------------------------------------------------*/
	
	public List<Adgroups> parseJsonToAdgroups(String response);
	
	public List<RptAdgroup> parseJsonToRptAdgroupsBase(String response);
	
	public int combineRptAdgroupsEffect(String response, Map<String, Integer> lastDayRecord, List<RptAdgroup> list);
	
	public void updateRptAdgroupsData(long userId, List<RptAdgroup> list);
	
	public Map<String, List<Adgroups> > splitAdgroups(List<Adgroups> newList, List<Adgroups> oldList);
	
}